home *** CD-ROM | disk | FTP | other *** search
/ PC/CD Gamer UK 120 / CD Gamer Issue 120 (March 2003) (Disc 2).ISO / mods / Q2_Codered / codeRED1_0.exe / Data1.cab / M_mambass.c < prev    next >
Encoding:
C/C++ Source or Header  |  2002-12-07  |  15.8 KB  |  648 lines

  1. /*
  2. ==============================================================================
  3.  
  4. Alien Robot/ w alien inside
  5.  
  6. ==============================================================================
  7. */
  8.  
  9. #include "g_local.h"
  10. #include "m_mambass.h"
  11.  
  12.  
  13. static int sound_pain;
  14. static int sound_die;
  15. static int sound_idle;
  16. static int sound_punch;
  17. static int sound_sight;
  18. static int sound_search;
  19.  
  20. void ambass_sight (edict_t *self, edict_t *other)
  21. {
  22.     gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
  23. }
  24.  
  25. void ambass_search (edict_t *self)
  26. {
  27.     gi.sound (self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0);
  28. }
  29.  
  30.  
  31. void ambass_fidget (edict_t *self);
  32. mframe_t ambass_frames_stand [] =
  33. {
  34.     ai_stand, 0, ambass_fidget,
  35.     ai_stand, 0, NULL,
  36.     ai_stand, 0, NULL,
  37.     ai_stand, 0, NULL,
  38.     ai_stand, 0, NULL,
  39.     ai_stand, 0, NULL,
  40.     ai_stand, 0, NULL
  41.     
  42. };
  43. mmove_t ambass_move_stand = {FRAME_attack01, FRAME_attack01, ambass_frames_stand, NULL};
  44.  
  45. void stomp_right (edict_t *self)
  46. {
  47.     int        i;
  48.     edict_t    *e;
  49.     vec3_t    forward, right;
  50.     vec3_t    start;
  51.  
  52.     for (i=1, e=g_edicts+i; i < globals.num_edicts; i++,e++)
  53.     {
  54.         if (!e->inuse)
  55.             continue;
  56.         if (!e->client)
  57.             continue;
  58.         if (!e->groundentity)
  59.             continue;
  60.  
  61.         e->groundentity = NULL;
  62.         e->velocity[0] += crandom()* 50;
  63.         e->velocity[1] += crandom()* 50;
  64.         e->velocity[2] += crandom()* 100;
  65.     }
  66.     
  67.     AngleVectors (self->s.angles, forward, right, NULL);
  68.     VectorCopy (self->s.origin, start);
  69.  
  70.     //start[2] = start[2] - 16;
  71.         
  72.     right[0] = right[0] * 15;
  73.     right[1] = right[1] * 15;
  74.     forward[0] = forward[0] * 10;
  75.     forward[1] = forward[1] * 10;
  76.  
  77.     VectorAdd(start, forward, start);
  78.     VectorAdd(start, right, start);
  79.  
  80.     gi.WriteByte (svc_temp_entity);
  81.     gi.WriteByte (TE_EXPLOSION2);
  82.     gi.WritePosition (start);
  83.     gi.multicast (start, MULTICAST_PVS);
  84.  
  85.     gi.sound (self, CHAN_VOICE, sound_die, 1, ATTN_NORM, 0);
  86.  
  87. }
  88. void stomp_left (edict_t *self)
  89. {
  90.     int        i;
  91.     edict_t    *e;
  92.     vec3_t    forward, right;
  93.     vec3_t    start;
  94.  
  95.     for (i=1, e=g_edicts+i; i < globals.num_edicts; i++,e++)
  96.     {
  97.         if (!e->inuse)
  98.             continue;
  99.         if (!e->client)
  100.             continue;
  101.         if (!e->groundentity)
  102.             continue;
  103.  
  104.         e->groundentity = NULL;
  105.         e->velocity[0] += crandom()* 50;
  106.         e->velocity[1] += crandom()* 50;
  107.         e->velocity[2] += crandom()* 100;
  108.     }
  109.     
  110.     AngleVectors (self->s.angles, forward, right, NULL);
  111.     VectorCopy (self->s.origin, start);
  112.     
  113.     //start[2] = start[2] - 16;
  114.     
  115.     right[0] = right[0] * -10;
  116.     right[1] = right[1] * -10;
  117.  
  118.     forward[0] = forward[0] * 15;
  119.     forward[1] = forward[1] * 15;
  120.  
  121.     VectorAdd(start, forward, start);
  122.     
  123.     VectorAdd(start, right, start);
  124.  
  125.     gi.WriteByte (svc_temp_entity);
  126.     gi.WriteByte (TE_EXPLOSION2);
  127.     gi.WritePosition (start);
  128.     gi.multicast (start, MULTICAST_PVS);
  129.  
  130.     gi.sound (self, CHAN_VOICE, sound_die, 1, ATTN_NORM, 0);
  131.  
  132. }
  133.  
  134. void fall (edict_t *self)
  135. {
  136.     int        i;
  137.  
  138.     edict_t    *e;
  139.     
  140.  
  141.     for (i=1, e=g_edicts+i; i < globals.num_edicts; i++,e++)
  142.     {
  143.         if (!e->inuse)
  144.             continue;
  145.         if (!e->client)
  146.             continue;
  147.         if (!e->groundentity)
  148.             continue;
  149.  
  150.         e->groundentity = NULL;
  151.         e->velocity[0] += crandom()* 250;
  152.         e->velocity[1] += crandom()* 250;
  153.         e->velocity[2] += crandom()* 500;
  154.     }
  155.     
  156.     gi.sound (self, CHAN_VOICE, sound_die, 1, ATTN_NORM, 0);
  157.  
  158. }
  159.  
  160. void ambass_stand (edict_t *self)
  161. {
  162.     self->monsterinfo.currentmove = &ambass_move_stand;
  163. }
  164.  
  165. mframe_t ambass_frames_stand_fidget [] =
  166. {
  167.     ai_stand, 0, NULL,
  168.     ai_stand, 0, NULL,
  169.     ai_stand, 0, NULL,
  170.     ai_stand, 0, NULL,
  171.     ai_stand, 0, NULL,
  172.     ai_stand, 0, NULL
  173. };
  174. mmove_t ambass_move_stand_fidget = {FRAME_attack01, FRAME_attack01, ambass_frames_stand_fidget, ambass_stand};
  175.  
  176. void ambass_fidget (edict_t *self)
  177. {
  178.     if (self->monsterinfo.aiflags & AI_STAND_GROUND)
  179.         return;
  180.     if (random() > 0.15)
  181.         return;
  182.  
  183.     self->monsterinfo.currentmove = &ambass_move_stand_fidget;
  184.     gi.sound (self, CHAN_WEAPON, sound_idle, 1, ATTN_IDLE, 0);
  185. }
  186.  
  187. //----leader stuff
  188.  
  189.  
  190. void mleader_fidget (edict_t *self);
  191. mframe_t mleader_frames_stand [] =
  192. {
  193.     ai_stand, 0, mleader_fidget,
  194.     ai_stand, 0, NULL,
  195.     ai_stand, 0, NULL,
  196.     ai_stand, 0, NULL,
  197.     ai_stand, 0, NULL,
  198.     ai_stand, 0, NULL
  199.     
  200. };
  201. mmove_t mleader_move_stand = {FRAME_stand01, FRAME_stand06, mleader_frames_stand, NULL};
  202.  
  203. void mleader_stand (edict_t *self)
  204. {
  205.     self->monsterinfo.currentmove = &mleader_move_stand;
  206. }
  207.  
  208. mframe_t mleader_frames_stand_fidget [] =
  209. {
  210.     ai_stand, 0, NULL,
  211.     ai_stand, 0, NULL,
  212.     ai_stand, 0, NULL,
  213.     ai_stand, 0, NULL,
  214.     ai_stand, 0, NULL,
  215.     ai_stand, 0, NULL,
  216.     ai_stand, 0, NULL,
  217.     ai_stand, 0, NULL,
  218.     ai_stand, 0, NULL,
  219.     ai_stand, 0, NULL,
  220.     ai_stand, 0, NULL
  221. };
  222. mmove_t mleader_move_stand_fidget = {FRAME_fidget01, FRAME_fidget11, mleader_frames_stand_fidget, mleader_stand};
  223.  
  224. void mleader_fidget (edict_t *self)
  225. {
  226.     if (self->monsterinfo.aiflags & AI_STAND_GROUND)
  227.         return;
  228.     if (random() > 0.15)
  229.         return;
  230.  
  231.     self->monsterinfo.currentmove = &mleader_move_stand_fidget;
  232.     gi.sound (self, CHAN_WEAPON, sound_idle, 1, ATTN_IDLE, 0);
  233. }
  234.  
  235.  
  236.  
  237. mframe_t ambass_frames_walk [] =
  238. {
  239.     ai_walk, 3.1, NULL,
  240.     ai_walk, 4.3, NULL,
  241.     ai_walk, 4.9, NULL,
  242.     ai_walk, 2.7, NULL,
  243.     ai_walk, 3.0, NULL,
  244.     ai_walk, 3.2, NULL,
  245.     ai_walk, 4.9, NULL,
  246.     ai_walk, 2.7, NULL,
  247.     ai_walk, 3.0, NULL,
  248.     ai_walk, 3.2, NULL,
  249.     ai_walk, 4.2, NULL,
  250.     ai_walk, 3.1, NULL
  251. };
  252. mmove_t ambass_move_walk = {FRAME_run01, FRAME_run12, ambass_frames_walk, NULL};
  253.  
  254. void ambass_walk (edict_t *self)
  255. {
  256.     self->monsterinfo.currentmove = &ambass_move_walk;
  257.     gi.sound (self, CHAN_WEAPON, sound_idle, 1, ATTN_NORM, 0);
  258. }
  259.  
  260. mframe_t ambass_frames_run1 [] =
  261. {
  262.     ai_run, 10, NULL,
  263.     ai_run, 15, NULL,
  264.     ai_run, 20, NULL,
  265.     ai_run, 15, NULL,
  266.     ai_run, 0, stomp_right,
  267.     ai_run, 6, NULL,
  268.     ai_run, 11, NULL,
  269.     ai_run, 15, NULL,
  270.     ai_run, 20, NULL,
  271.     ai_run, 16, NULL,
  272.     ai_run, 0, stomp_left,
  273.     ai_run, 5, NULL
  274. };
  275. mmove_t ambass_move_run1 = {FRAME_run01, FRAME_run12, ambass_frames_run1, NULL};
  276.  
  277. void ambass_run (edict_t *self)
  278. {
  279.     if (self->monsterinfo.aiflags & AI_STAND_GROUND)
  280.         self->monsterinfo.currentmove = &ambass_move_stand;
  281.     else
  282.         self->monsterinfo.currentmove = &ambass_move_run1;
  283.     gi.sound (self, CHAN_WEAPON, sound_idle, 1, ATTN_NORM, 0);
  284. }
  285.  
  286.  
  287. void ambass_attack_spike (edict_t *self)
  288. {
  289.     static    vec3_t    aim = {MELEE_DISTANCE, 0, -24};
  290.     gi.sound (self, CHAN_WEAPON, sound_search, 1, ATTN_NORM, 0);
  291.     fire_hit (self, aim, (15 + (rand() % 6)), 100);        //    Faster attack -- upwards and backwards
  292. }
  293.  
  294.  
  295. void ambass_swing (edict_t *self)
  296. {
  297.     gi.sound (self, CHAN_WEAPON, sound_punch, 1, ATTN_NORM, 0);
  298. }
  299.  
  300. void ambassShot (edict_t *self)
  301. {
  302.     vec3_t    forward, right;
  303.     vec3_t    start;
  304.     vec3_t    dir;
  305.     vec3_t    vec;
  306.  
  307.     AngleVectors (self->s.angles, forward, right, NULL);
  308.     G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_JORG_BFG_1], forward, right, start);
  309.  
  310.     VectorCopy (self->enemy->s.origin, vec);
  311.     vec[2] += self->enemy->viewheight;
  312.     VectorSubtract (vec, self->s.origin, dir);
  313.     VectorNormalize (dir);
  314.     //gi.sound (self, CHAN_VOICE, sound_attack2, 1, ATTN_NORM, 0);
  315.     /*void monster_fire_bfg (edict_t *self, 
  316.                              vec3_t start, 
  317.                              vec3_t aimdir, 
  318.                              int damage, 
  319.                              int speed, 
  320.                              int kick, 
  321.                              float damage_radius, 
  322.                              int flashtype)*/
  323.     gi.sound (self, CHAN_VOICE, sound_punch, 1, ATTN_NORM, 0);
  324.     monster_fire_bfg (self, self->s.origin, dir, 50, 300, 100, 200, MZ2_JORG_BFG_1);
  325. }
  326.  
  327. void ambass_strike (edict_t *self)
  328. {
  329.     static    vec3_t    aim = {MELEE_DISTANCE, 0, -24};
  330.     gi.sound (self, CHAN_WEAPON, sound_search, 1, ATTN_NORM, 0);
  331.     fire_hit (self, aim, (75 + (rand() % 6)), 100);        //    Faster attack -- upwards and backwards
  332. }
  333.  
  334. mframe_t ambass_frames_attack_spike [] =
  335. {
  336.         ai_charge, 0, NULL,
  337.         ai_charge, 0, NULL,
  338.         ai_charge, 0, NULL,
  339.         ai_charge, 0, NULL,
  340.         ai_charge, 0, ambass_strike,
  341.         ai_charge, 0, NULL,
  342.         ai_charge, 0, NULL
  343. };
  344. mmove_t ambass_move_attack_spike = {FRAME_attack01, FRAME_attack07, ambass_frames_attack_spike, ambass_run};
  345.  
  346.  
  347. void ambass_attack_club (edict_t *self)
  348. {
  349.     vec3_t    aim;
  350.  
  351.     VectorSet (aim, MELEE_DISTANCE, self->mins[0], -4);
  352.     fire_hit (self, aim, (5 + (rand() % 6)), 400);        // Slower attack
  353. }
  354.  
  355. mframe_t ambass_frames_attack_club [] =
  356. {    
  357.     ai_charge, 0, NULL,
  358.         ai_charge, 0, NULL,
  359.         ai_charge, 0, NULL,
  360.         ai_charge, 0, NULL,
  361.         ai_charge, 0, ambass_strike,
  362.         ai_charge, 0, NULL,
  363.         ai_charge, 0, NULL
  364. };
  365. mmove_t ambass_move_attack_club = {FRAME_attack01, FRAME_attack07, ambass_frames_attack_club, ambass_run};
  366.  
  367.  
  368.  
  369.  
  370. mframe_t ambass_frames_attack_strike [] =
  371. {
  372.     ai_charge, 0, NULL,
  373.         ai_charge, 0, NULL,
  374.         ai_charge, 0, NULL,
  375.         ai_charge, 0, NULL,
  376.         ai_charge, 0, ambass_strike,
  377.         ai_charge, 0, NULL,
  378.         ai_charge, 0, NULL
  379. };
  380.     
  381. mmove_t ambass_move_attack_strike = {FRAME_attack01, FRAME_attack07, ambass_frames_attack_strike, ambass_run};
  382.  
  383.  
  384. void ambass_melee (edict_t *self)
  385. {
  386.     if ((rand() % 2) == 0)
  387.         self->monsterinfo.currentmove = &ambass_move_attack_spike;
  388.     else
  389.         self->monsterinfo.currentmove = &ambass_move_attack_club;
  390. }
  391.  
  392. mframe_t mleader_frames_attack_spike [] =
  393. {
  394.         ai_charge, 0, NULL,
  395.         ai_charge, 0, NULL,
  396.         ai_charge, 0, NULL,
  397.         ai_charge, 0, NULL,
  398.         ai_charge, 0, ambassShot,
  399.         ai_charge, 0, NULL,
  400.         ai_charge, 0, NULL
  401. };
  402. mmove_t mleader_move_attack_spike = {FRAME_attack01, FRAME_attack07, mleader_frames_attack_spike, ambass_run};
  403.  
  404.  
  405. void mleader_attack_club (edict_t *self)
  406. {
  407.     vec3_t    aim;
  408.  
  409.     VectorSet (aim, MELEE_DISTANCE, self->mins[0], -4);
  410.     fire_hit (self, aim, (5 + (rand() % 6)), 400);        // Slower attack
  411. }
  412.  
  413. mframe_t mleader_frames_attack_club [] =
  414. {    
  415.     ai_charge, 0, NULL,
  416.         ai_charge, 0, NULL,
  417.         ai_charge, 0, NULL,
  418.         ai_charge, 0, NULL,
  419.         ai_charge, 0, ambassShot,
  420.         ai_charge, 0, NULL,
  421.         ai_charge, 0, NULL
  422. };
  423. mmove_t mleader_move_attack_club = {FRAME_attack01, FRAME_attack07, mleader_frames_attack_club, ambass_run};
  424.  
  425.  
  426.  
  427.  
  428. mframe_t mleader_frames_attack_strike [] =
  429. {
  430.     ai_charge, 0, NULL,
  431.         ai_charge, 0, NULL,
  432.         ai_charge, 0, NULL,
  433.         ai_charge, 0, NULL,
  434.         ai_charge, 0, ambassShot,
  435.         ai_charge, 0, NULL,
  436.         ai_charge, 0, NULL
  437. };
  438.     
  439. mmove_t mleader_move_attack_strike = {FRAME_attack01, FRAME_attack07, mleader_frames_attack_strike, ambass_run};
  440.  
  441.  
  442. void mleader_melee (edict_t *self)
  443. {
  444.     if ((rand() % 2) == 0)
  445.         self->monsterinfo.currentmove = &mleader_move_attack_spike;
  446.     else
  447.         self->monsterinfo.currentmove = &mleader_move_attack_club;
  448. }
  449. /*
  450. void()     ambass_atke1    =[    $r_attb1,    ambass_atke2    ] {ai_run(9);};
  451. void()     ambass_atke2    =[    $r_attb2,    ambass_atke3    ] {ai_run(6);};
  452. void()     ambass_atke3    =[    $r_attb3,    ambass_atke4    ] {ai_run(18.4);};
  453. void()     ambass_atke4    =[    $r_attb4,    ambass_atke5    ] {ai_run(25);};
  454. void()     ambass_atke5    =[    $r_attb5,    ambass_atke6    ] {ai_run(14);};
  455. void()     ambass_atke6    =[    $r_attb6,    ambass_atke7    ] {ai_run(20);};
  456. void()     ambass_atke7    =[    $r_attb7,    ambass_atke8    ] {ai_run(8.5);};
  457. void()     ambass_atke8    =[    $r_attb8,    ambass_atke9    ] {ai_run(3);};
  458. void()     ambass_atke9    =[    $r_attb9,    ambass_atke10    ] {ai_run(17.5);};
  459. void()     ambass_atke10    =[    $r_attb10,    ambass_atke11    ] {ai_run(17);};
  460. void()     ambass_atke11    =[    $r_attb11,    ambass_atke12    ] {ai_run(9);};
  461. void()     ambass_atke12    =[    $r_attb12,    ambass_atke13    ] {ai_run(25);};
  462. void()     ambass_atke13    =[    $r_attb13,    ambass_atke14    ] {ai_run(3.7);};
  463. void()     ambass_atke14    =[    $r_attb14,    ambass_atke15    ] {ai_run(2.6);};
  464. void()     ambass_atke15    =[    $r_attb15,    ambass_atke16    ] {ai_run(19);};
  465. void()     ambass_atke16    =[    $r_attb16,    ambass_atke17    ] {ai_run(25);};
  466. void()     ambass_atke17    =[    $r_attb17,    ambass_atke18    ] {ai_run(19.6);};
  467. void()     ambass_atke18    =[    $r_attb18,    ambass_run1    ] {ai_run(7.8);};
  468. */
  469.  
  470.  
  471. mframe_t ambass_frames_pain1 [] =
  472. {
  473.     ai_move, 0, NULL,
  474.     ai_move, 0, NULL,
  475.     ai_move, 0, NULL,
  476.     ai_move, 0, NULL,
  477.     ai_move, 0, NULL,
  478.     ai_move, 0, NULL,
  479.     ai_move, 0, NULL,
  480.     ai_move, 0, NULL
  481. };
  482. mmove_t ambass_move_pain1 = {FRAME_run01, FRAME_run08, ambass_frames_pain1, ambass_run};
  483.  
  484.  
  485. mframe_t ambass_frames_pain2 [] =
  486. {
  487.     ai_move, 0, NULL,
  488.     ai_move, 0, NULL,
  489.     ai_move, 0, NULL,
  490.     ai_move, 0, NULL,
  491.     ai_move, 0, NULL,
  492.     ai_move, 0, NULL,
  493.     ai_move, 0, NULL,
  494.     ai_move, 0, NULL
  495. };
  496. mmove_t ambass_move_pain2 = {FRAME_run01, FRAME_run08, ambass_frames_pain2, ambass_run};
  497.  
  498. void ambass_pain (edict_t *self, edict_t *other, float kick, int damage)
  499. {
  500.     vec3_t end;
  501.     
  502.     if (level.time < self->pain_debounce_time)
  503.         return;
  504.  
  505.     self->pain_debounce_time = level.time + 3;
  506.     gi.sound (self, CHAN_VOICE, sound_pain, 1, ATTN_NORM, 0);
  507.  
  508.     if(self->health < 300)
  509.     {
  510.         VectorCopy(self->s.origin, end);
  511.         end[2] += 64;
  512.         gi.WriteByte (svc_temp_entity);
  513.         gi.WriteByte (TE_EXPLOSION1);
  514.         gi.WritePosition (end);
  515.         gi.multicast (end, MULTICAST_PVS);
  516.         self->s.skinnum = 1;
  517.         self->s.effects |= EF_ROCKET;//make him damaged and smoking
  518.     }
  519.  
  520.     if ((damage < 20) || (random() < 0.5))
  521.         self->monsterinfo.currentmove = &ambass_move_pain1;
  522.     else
  523.         self->monsterinfo.currentmove = &ambass_move_pain2;
  524. }
  525.  
  526. void ambass_dead (edict_t *self)
  527. {
  528.     VectorSet (self->mins, -32, -32, 0);
  529.     VectorSet (self->maxs, 32, 32, 48);
  530.     self->movetype = MOVETYPE_TOSS;
  531.     self->svflags |= SVF_DEADMONSTER;
  532.     self->nextthink = 0;
  533.     gi.linkentity (self);
  534.  
  535. }
  536.  
  537. mframe_t ambass_frames_death1 [] =
  538. {
  539.     ai_move, 0, NULL,
  540.     ai_move, 0, NULL,
  541.     ai_move, 0, NULL,
  542.     ai_move, 0, NULL,
  543.     ai_move, 0, NULL,
  544.     ai_move, 0, NULL,
  545.     ai_move, 0, fall
  546.     
  547. };
  548. mmove_t ambass_move_death1 = {FRAME_stand01, FRAME_fidget01, ambass_frames_death1, ambass_dead};
  549.  
  550. mframe_t ambass_frames_death2 [] =
  551. {
  552.     ai_move, 0, NULL,
  553.     ai_move, 0, NULL,
  554.     ai_move, 0, NULL,
  555.     ai_move, 0, NULL,
  556.     ai_move, 0, NULL,
  557.     ai_move, 0, NULL,
  558.     ai_move, 0, fall
  559. };
  560. mmove_t ambass_move_death2 = {FRAME_stand01, FRAME_fidget01, ambass_frames_death2, ambass_dead};
  561.  
  562.  
  563. void ambass_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
  564. {
  565.     vec3_t end;
  566.  
  567.     gi.sound (self, CHAN_VOICE, sound_die, 1, ATTN_NORM, 0);
  568.     
  569.     self->takedamage = DAMAGE_NO;
  570.     VectorCopy(self->s.origin, end);
  571.     end[2] += 64;
  572.     gi.WriteByte (svc_temp_entity);
  573.     gi.WriteByte (TE_EXPLOSION1);
  574.     gi.WritePosition (end);
  575.     gi.multicast (end, MULTICAST_PVS);
  576.     
  577.     ThrowDebris (self, "models/objects/gibs/robot_leg/tris.md2", 0, end);
  578.     self->s.modelindex = gi.modelindex("models/monsters/martian_robot/tris2.md2");
  579.     self->s.skinnum = 1;
  580.  
  581.     self->deadflag = DEAD_DEAD;
  582.     
  583.     
  584.     if (damage >= 50)
  585.         self->monsterinfo.currentmove = &ambass_move_death1;
  586.     else
  587.         self->monsterinfo.currentmove = &ambass_move_death2;
  588. }
  589.  
  590. /*QUAKED monster_ambass (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight
  591. */
  592. void SP_monster_ambass (edict_t *self)
  593. {
  594.     if (deathmatch->value)
  595.     {
  596.         G_FreeEdict (self);
  597.         return;
  598.     }
  599.  
  600.     // pre-caches
  601.     sound_pain  = gi.soundindex ("martian/robotmove.wav");
  602.     
  603.  
  604.     sound_punch = gi.soundindex ("martian/shoot1.wav");
  605.     sound_search = gi.soundindex ("robot9/mach2.wav");
  606.     sound_sight = gi.soundindex ("martian/robotmov.wav");
  607.       
  608.     sound_idle = gi.soundindex ("robot9/mach.wav");
  609.     sound_die = gi.soundindex ("martian/step.wav");
  610.  
  611.     self->s.modelindex = gi.modelindex("models/monsters/martian_robot/tris.md2");
  612.     self->s.modelindex2 = gi.modelindex("models/monsters/robot_top/tris.md2");
  613.     self->s.modelindex3 = gi.modelindex("models/monsters/robot_head/tris.md2");
  614.  
  615.     VectorSet (self->mins, -32, -32, 0);
  616.     VectorSet (self->maxs, 32, 32, 156);
  617.     self->movetype = MOVETYPE_STEP;
  618.     self->solid = SOLID_BBOX;
  619.     self->s.skinnum = 0;
  620.  
  621.     self->max_health = 600;
  622.     self->health = self->max_health;
  623.     self->gib_health = 0;
  624.     self->mass = 450;
  625.  
  626.     self->classname = "monster_ambass";
  627.  
  628.     self->pain = ambass_pain;
  629.     self->die = ambass_die;
  630.  
  631.     self->monsterinfo.stand = ambass_stand;
  632.     self->monsterinfo.walk = ambass_walk;
  633.     self->monsterinfo.run = ambass_run;
  634.     self->monsterinfo.dodge = NULL;
  635.     self->monsterinfo.attack = NULL;
  636.     self->monsterinfo.melee = ambass_melee;
  637.     self->monsterinfo.sight = ambass_sight;
  638.     self->monsterinfo.search = ambass_search;
  639.  
  640.     self->monsterinfo.currentmove = &ambass_move_stand;
  641.     self->monsterinfo.scale = MODEL_SCALE;
  642.  
  643.     gi.linkentity (self);
  644.  
  645.     walkmonster_start (self);
  646.     
  647. }
  648.